<?php

namespace app\admin\controller;

use app\admin\model\Admin;
use think\Controller;
use think\Request;

class Login extends Controller
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function login()
    {
        return view('admin@login/login');
    }
    public function index(Request $request)
    {
        $input = $request->post();
        $res = (new Admin())->getLogin($input);
        if($res==1){
            session('admin_user',$input);
            return 1;
        }else{
            return $res;
        }

    }
}
